Fix VK Full Admin OAuth scope generation#181
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#180
Solution summaryImplemented and pushed the fix to PR 181: #181 Changed Verified against VK docs:
Local checks passed: targeted VK test, This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (194.5K + 9.3M cached) input tokens, 20.9K output tokens, $12.199925 cost 🤖 Models used:
📎 Log file uploaded as Gist (13606KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 5768078.
Summary
Fixes
vk_auth_user_url/vk_auth_group_urlOAuth URL generation for current VK auth behavior.vk_auth_user_urlno longer requests the restrictedmessagesuser scope, which VK rejects for ordinary/new apps withinvalid_scope/invalid scope.https://oauth.vk.ru/authorizeand comma-separated scope names instead of numeric bitmasks.messagesscope needed only byvk_user_messages_send.Fixes #180
Reproduction
Before this PR,
vk_auth_user_urldefaulted tooffline, wall, messages, friends, photos, groups, stats, notificationsand encoded scopes as a numeric mask. Opening that generated URL can fail at VK with an invalid scope error becausemessagesis restricted to eligible standalone apps that passed moderation or already had that access.The new test verifies the default user OAuth URL excludes
messages, usesoauth.vk.ru, and emits readable comma-separated scope names.messagescan still be requested explicitly by eligible apps throughvk_auth_user_url.scopes.Tests
node --test plugins/vk-full-admin/tests/index.test.jsnpm run validate(passes with existingcasinoempty-tools warning)npm run lint(passes with existing repo warnings, 0 errors)npm test(410 passing)npm run typechecknode scripts/build-sdk.mjsnpm audit --audit-level=high --prefix plugins/vk-full-adminnpm audit --audit-level=high(passes high threshold; existing root moderate advisories remain)